﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace CS795.TravelAgency.Models
{
    public class CustomerViewModel
    {
        [Required]
        [HiddenInput(DisplayValue = false)]
        public int Id { get; set; }

        [Required]
        [Display(Name = "Customer Name")]
        public string Name { get; set; }

        [Required]
        [EmailAddress]
        [Display(Name = "Email Address")]
        public string Email { get; set; }
    }

    public class TripSummaryViewModel
    {
        [HiddenInput(DisplayValue = false)]
        [Display(Name = "Trip Identifier")]
        public int Id { get; set; }

        [Required]
        [Display(Name = "Trip Name")]
        public string Name { get; set; }
    }

    public class CarRentalRequestViewModel
    {
        [Required]
        [Display(Name = "Car Type")]
        public string CarType { get; set; }

        [Required]
        [Display(Name = "Start Date")]
        [DataType(DataType.Date)]
        public DateTime StartDate { get; set; }

        [Required]
        [Display(Name = "End Date")]
        [DataType(DataType.Date)]
        public DateTime EndDate { get; set; }
    }

    public class CarRentalViewModel
    {
        [Required]
        [Display(Name = "Car Rental ID")]
        public int Id { get; set; }

        [Required]
        [Display(Name = "Vendor")]
        public string Vendor { get; set; }

        [Required]
        [Display(Name = "Quote ID")]
        public int QuoteId { get; set; }

        [Required]
        [Display(Name = "Car Type")]
        public string CarType { get; set; }

        [Required]
        [Display(Name = "Start Date")]
        [DataType(DataType.Date)]
        public DateTime StartDate { get; set; }

        [Required]
        [Display(Name = "End Date")]
        [DataType(DataType.Date)]
        public DateTime EndDate { get; set; }

        [Required]
        [Display(Name = "Price Per Day")]
        [DataType(DataType.Currency)]
        public decimal PricePerDay { get; set; }

        [Required]
        [Display(Name = "Total Price")]
        [DataType(DataType.Currency)]
        public decimal TotalPrice { get; set; }

        [Required]
        [Display(Name = "Status")]
        public string Status { get; set; }
    }

    public class FlightRequestViewModel
    {
        [Required]
        [Display(Name = "Seat Type")]
        public string SeatType { get; set; }

        [Required]
        [Display(Name = "Number of Seats")]
        public int Count { get; set; }

        [Required]
        [Display(Name = "Departure")]
        public string Departure { get; set; }

        [Required]
        [Display(Name = "Destination")]
        public string Destination { get; set; }

        [Required]
        [Display(Name = "Date")]
        [DataType(DataType.Date)]
        public DateTime Date { get; set; }
    }

    public class FlightViewModel
    {
        [Required]
        [Display(Name = "Flight ID")]
        public int Id { get; set; }

        [Required]
        [Display(Name = "Vendor")]
        public string Vendor { get; set; }

        [Required]
        [Display(Name = "Quote ID")]
        public int QuoteId { get; set; }

        [Required]
        [Display(Name = "Seat Type")]
        public string SeatType { get; set; }

        [Required]
        [Display(Name = "Number of Seats")]
        public int Count { get; set; }

        [Required]
        [Display(Name = "Departure")]
        public string Departure { get; set; }

        [Required]
        [Display(Name = "Destination")]
        public string Destination { get; set; }

        [Required]
        [Display(Name = "Date")]
        [DataType(DataType.Date)]
        public DateTime Date { get; set; }

        [Required]
        [Display(Name = "Price Per Seat")]
        [DataType(DataType.Currency)]
        public decimal PricePerSeat { get; set; }

        [Required]
        [Display(Name = "Total Price")]
        [DataType(DataType.Currency)]
        public decimal TotalPrice { get; set; }

        [Required]
        [Display(Name = "Status")]
        public string Status { get; set; }
    }

    public class HotelRequestViewModel
    {
        [Required]
        [Display(Name = "Room Type")]
        public string RoomType { get; set; }

        [Required]
        [Display(Name = "Smoking?")]
        public bool Smoking { get; set; }

        [Required]
        [Display(Name = "Check In Date")]
        [DataType(DataType.Date)]
        public DateTime CheckIn { get; set; }

        [Required]
        [Display(Name = "Check Out Date")]
        [DataType(DataType.Date)]
        public DateTime CheckOut { get; set; }
    }

    public class HotelViewModel
    {
        [Required]
        [Display(Name = "Hotel ID")]
        public int Id { get; set; }

        [Required]
        [Display(Name = "Vendor")]
        public string Vendor { get; set; }

        [Required]
        [Display(Name = "Quote ID")]
        public int QuoteId { get; set; }

        [Required]
        [Display(Name = "Room Type")]
        public string RoomType { get; set; }

        [Required]
        [Display(Name = "Smoking?")]
        public bool Smoking { get; set; }

        [Required]
        [Display(Name = "Check In Date")]
        [DataType(DataType.Date)]
        public DateTime CheckIn { get; set; }

        [Required]
        [Display(Name = "Check Out Date")]
        [DataType(DataType.Date)]
        public DateTime CheckOut { get; set; }

        [Required]
        [Display(Name = "Price Per Night")]
        [DataType(DataType.Currency)]
        public decimal PricePerNight { get; set; }

        [Required]
        [Display(Name = "Total Price")]
        [DataType(DataType.Currency)]
        public decimal TotalPrice { get; set; }

        [Required]
        [Display(Name = "Status")]
        public string Status { get; set; }
    }

    public class TripDetailsViewModel
    {
        [Required]
        [HiddenInput(DisplayValue = false)]
        public int Id { get; set; }

        [Required]
        [Display(Name = "Trip Name")]
        public string Name { get; set; }

        [Required]
        [Display(Name = "Customer")]
        public string Customer { get; set; }

        public List<CarRentalViewModel> CarRentals { get; set; }
        public List<FlightViewModel> Flights { get; set; }
        public List<HotelViewModel> Hotels { get; set; }
    }

    public class TripConfirmationViewModel
    {
        [Required]
        [HiddenInput(DisplayValue = false)]
        public int ReservationId { get; set; }

        [Required]
        [Display(Name = "Customer Name")]
        public string Name { get; set; }

        [Required]
        [Display(Name = "Address (Line 1)")]
        public string Address1 { get; set; }

        [Display(Name = "Address (Line 2)")]
        public string Address2 { get; set; }

        [Required]
        [Display(Name = "City")]
        public string City { get; set; }

        [Required]
        [Display(Name = "State")]
        [StringLength(2, MinimumLength=2, ErrorMessage = "State must be exactly 2 characters")]
        public string State { get; set; }

        [Required]
        [Display(Name = "Zip Code")]
        [RegularExpression(@"^\d{5}(-\d{4})?$", ErrorMessage = "Invalid Zip")]
        public string ZipCode { get; set; }

        [Required]
        [Display(Name = "Credt Card Number")]
        [RegularExpression(@"^\d{16}$", ErrorMessage = "Invalid Card Number")]
        public string CardNumber { get; set; }

        [Required]
        [Display(Name = "Credit Card Type")]
        public string CardType { get; set; }

        [Required]
        [Range(1, 12, ErrorMessage = "Please enter a valid numerical representation for a month")]
        [Display(Name = "Expiration Month")]
        public int ExpirationMonth { get; set; }

        [Required]
        [Range(2014, 3000, ErrorMessage = "Please enter a valid year")]
        [Display(Name = "Expiration Year")]
        public int ExpirationYear { get; set; }
    }
}